﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// UpPackBXHis数据模型对象
    /// </summary>
    [Serializable]
    public partial class UpPackBXHisMod
    {
        /// <summary>
        /// 初始化UpPackBXHis数据模型对象
        /// </summary>
        public UpPackBXHisMod()
        {
            
        }
        /// <summary>
        /// 初始化UpPackBXHis数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        public UpPackBXHisMod(long iD)
        {
            //给ID字段赋值
            this.ID = iD;
        }
        /// <summary>
        /// 初始化UpPackBXHis数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="deviceNO">DeviceNO</param>
        /// <param name="upKey">UpKey</param>
        /// <param name="upRet">UpRet</param>
        /// <param name="changeTime">ChangeTime</param>
        public UpPackBXHisMod(long iD,string deviceNO,string upKey,int? upRet,DateTime? changeTime)
        {
            //给ID字段赋值
            this.ID = iD;
            //给DeviceNO字段赋值
            this.DeviceNO = deviceNO;
            //给UpKey字段赋值
            this.UpKey = upKey;
            //给UpRet字段赋值
            this.UpRet = upRet;
            //给ChangeTime字段赋值
            this.ChangeTime = changeTime;
        }
        
		//属性存储数据的变量
        private long _iD;
        private string _deviceNO;
        private string _upKey;
        private int? _upRet;
        private DateTime? _changeTime;
        
        /// <summary>
        /// ID
        /// </summary>
        public long ID
        {
            get { return this._iD; }
            set { this._iD = value; }
        }
        /// <summary>
        /// DeviceNO
        /// </summary>
        public string DeviceNO
        {
            get { return this._deviceNO; }
            set { this._deviceNO = value; }
        }
        /// <summary>
        /// UpKey
        /// </summary>
        public string UpKey
        {
            get { return this._upKey; }
            set { this._upKey = value; }
        }
        /// <summary>
        /// UpRet
        /// </summary>
        public int? UpRet
        {
            get { return this._upRet; }
            set { this._upRet = value; }
        }
        /// <summary>
        /// ChangeTime
        /// </summary>
        public DateTime? ChangeTime
        {
            get { return this._changeTime; }
            set { this._changeTime = value; }
        }
        
        /// <summary>
        /// 对比两个UpPackBXHis数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的UpPackBXHis数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成UpPackBXHis数据模型对象
            UpPackBXHisMod upPackBXHisMod = obj as UpPackBXHisMod;
            //判断是否转换成功
            if (upPackBXHisMod == null) return false;
            //进行匹配属性的值
            return
                //判断ID是否一致
                this.ID == upPackBXHisMod.ID &&
                //判断DeviceNO是否一致
                this.DeviceNO == upPackBXHisMod.DeviceNO &&
                //判断UpKey是否一致
                this.UpKey == upPackBXHisMod.UpKey &&
                //判断UpRet是否一致
                this.UpRet == upPackBXHisMod.UpRet &&
                //判断ChangeTime是否一致
                this.ChangeTime == upPackBXHisMod.ChangeTime;
        }
        /// <summary>
        /// 将当前UpPackBXHis数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将UpPackBXHis数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将ID进行按位异或运算处理
                this.ID.GetHashCode() ^
                //将DeviceNO进行按位异或运算处理
                (this.DeviceNO == null ? 2147483647 : this.DeviceNO.GetHashCode()) ^
                //将UpKey进行按位异或运算处理
                (this.UpKey == null ? 2147483647 : this.UpKey.GetHashCode()) ^
                //将UpRet进行按位异或运算处理
                (this.UpRet == null ? 2147483647 : this.UpRet.GetHashCode()) ^
                //将ChangeTime进行按位异或运算处理
                (this.ChangeTime == null ? 2147483647 : this.ChangeTime.GetHashCode());
        }
        /// <summary>
        /// 将当前UpPackBXHis数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前UpPackBXHis数据模型对象转换成字符串副本
            return
                "[" +
                //将ID转换成字符串
                this.ID +
                "]";
        }
    }
}
